/*
 * @Title ThreadInfo.java
 * @Copyright Copyright 2010-2015 Yann Software Co,.Ltd All Rights Reserved.
 * @Description��
 * @author Yann
 * @date 2015-8-7 ����10:16:34
 * @version 1.0
 */
package com.smallkingson.ylib.net.download;

import android.util.Pair;

import com.smallkingson.ylib.db.bean.KeyObtainable;

public class ThreadInfo implements KeyObtainable {
	private int id;
	private String url;
	private long start;
	private long end;
	private long finished;

	public ThreadInfo() {
	}

	/**
	 * @param id
	 * @param url
	 * @param start
	 * @param end
	 * @param finished
	 */
	public ThreadInfo(int id, String url, long start, long end, long finished) {
		this.id = id;
		this.url = url;
		this.start = start;
		this.end = end;
		this.finished = finished;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public long getStart() {
		return start;
	}

	public void setStart(long start) {
		this.start = start;
	}

	public long getEnd() {
		return end;
	}

	public void setEnd(long end) {
		this.end = end;
	}

	public long getFinished() {
		return finished;
	}

	public void setFinished(long finished) {
		this.finished = finished;
	}

	@Override
	public String toString() {
		return "ThreadInfo [id=" + id + ", url=" + url + ", start=" + start
				+ ", end=" + end + ", finished=" + finished + "]";
	}
	@Override
	public Pair<String, Object>[] obtainKey() {
		return new Pair[]{
				new Pair<>("id", this.id)
		};
	}
}
